{% extends "single.html" %}

{% block title %}Setting{% endblock %}
{% block navpath %}
  <div class="page-header">
    <h1><small>修改头像</small></h1>
  </div>
{% endblock %}
{% block main %}
  <div class="col-xs-6">

    <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data">
      {% csrf_token %}
      <div class="form-group">
        <label for="avatar" class="col-sm-2 control-label">{{ form.fields.avatar.label }}</label>
        <div class="col-sm-10">
          <label class="control-label">目前:</label><span class="text-muted"><a href="{{ MEDIA_URL }}150/{{ account.avatar }}">{{ account.avatar }}</a></span>
          <input type="button" value="清除">
          <p></p>
          <label class="control-label">修改:</label><input type="file" class="form-control" id="avatar" name="avatar" value="{{ account.avatar }}">
          <span class="text-muted">{{ form.fields.avatar.help_text }}</span>
          {% if form.avatar.errors %}
            {% for error in form.avatar.errors %}
              <p class="alert-danger" >{{ error }}</p>
            {% endfor %}
          {% endif %}
        </div>
      </div>
      <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
          <button type="submit" class="btn btn-default">修改</button>
        </div>
      </div>
    </form>
  </div>
{% endblock %}
